<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

$urlParams = $generator->generateUrlParams();

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */

$this->title = <?= $generator->generateString(Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?> . ': ' . $model-><?= $generator->getNameAttribute() ?>;
$this->params['title'] = <?= $model_many_string = $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>;
$this->params['title_desc'] = <?= $generator->generateString('View') ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $model_many_string ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = $model-><?= $generator->getNameAttribute() ?>;
?>
<div class="box box-primary <?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-view">
    <div class="box-header with-border">
        <?= '<?php ' ?> $_model = '<?= ltrim($generator->modelClass, '\\') ?>'; ?>
        <?= '<?php ' ?> if (isset($_model::$icon)): ?>
        <i class="<?= '<?= ' ?> $_model::icon() ?>"></i>
        <?= '<?php ' ?> endif; ?>
        <h1 class="box-title"><?= '<?=' ?> $model-><?= $generator->getNameAttribute() ?> ?></h1>
        <div class="box-tools">
            <?= "<?= " ?>Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-plus']) . ' ' .
            <?= $generator->generateString('Create ' . Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>,
            ['create'], ['class' => 'btn btn-success btn-sm']) ?>
            <?= "<?= " ?>Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-list']) . ' ' .
            <?= $model_many_string ?>, ['index'], ['class' => 'btn btn-default btn-sm']) ?>
        </div>
    </div>
    <div class="box-body">

    <?= "<?= " ?>DetailView::widget([
        'model' => $model,
        'attributes' => [
<?php
if (($tableSchema = $generator->getTableSchema()) === false) {
    foreach ($generator->getColumnNames() as $name) {
        echo "            '" . $name . "',\n";
    }
} else {
    foreach ($generator->getTableSchema()->columns as $column) {
        $format = $generator->generateColumnFormat($column);
        echo "            '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
    }
}
?>
        ],
    ]) ?>

    </div>
    <div class="box-footer">
        <?= "<?= " ?>Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-pencil']) . ' ' .
        <?= $generator->generateString('Update') ?>, ['update', <?= $urlParams ?>], ['class' => 'btn btn-primary btn-sm']) ?>
        <?= "<?= " ?>Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-trash']) . ' ' .
        <?= $generator->generateString('Delete') ?>, ['delete', <?= $urlParams ?>], [
        'class' => 'btn btn-danger btn-sm',
        'data' => [
        'confirm' => <?= $generator->generateString('Are you sure you want to delete this item?') ?>,
        'method' => 'post',
        ],
        ]) ?>
    </div>
</div>
